package com.bbzn.device.client.exception;

import com.bbzn.device.client.enums.ResultCode;
import lombok.Data;

/**
 * @Author wulongbo
 * @Date 2021/10/28 11:28
 * @Version 1.0
 */

@Data
public class DefinitException extends RuntimeException {

    private ResultCode resultCode;
    private Integer code;
    private String msg;

    public DefinitException() {
        this(1001, "接口错误");
    }

    public DefinitException(ResultCode resultCode) {
        this(resultCode.getCode(), resultCode.getMessage());
        this.resultCode=resultCode;
    }

    public DefinitException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}
